﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using BOHVote.DAL;

namespace BOHVote.BLL
{
    public static class UnitClass
    {
        #region <<  Unit  >>
        public static DataSet getUnitByGovern(string GovernID)
        {
            UnitProvide up = new UnitProvide();
            DataSet dst = up.getUintByGovern("", GovernID, false);

            return dst;
        }
        public static DataSet getUnitByGovern(string GovernID,bool IsALL)
        {
            UnitProvide up = new UnitProvide();
            DataSet dst = up.getUintByGovern("", GovernID, IsALL);

            return dst;
        }
        public static DataSet getUintByGovern(string UnitName, string GovernID)
        {
            UnitProvide up = new UnitProvide();
            DataSet dst = up.getUintByGovern(UnitName, GovernID, true);

            return dst;
        }

        public static DataSet getUnitByID(string ID)
        {
            UnitProvide up = new UnitProvide();

            return up.getUnitByID(ID);
        }

        public static int DeleteUnitByID(string UnitID)
        {
            UnitProvide up = new UnitProvide();
            return up.DeleteUnitByID(UnitID);
        }


        public static int InserUnit(string UnitID, string GovernID, string UnitName, string address, string PostalCode, string ContactPerson, string ContactPhone, string HospitalLevel, string MaxID, string status)
        {
            UnitProvide up = new UnitProvide();
            return up.InsertUnit(UnitID,GovernID,UnitName,address,PostalCode,ContactPerson,ContactPhone,HospitalLevel,MaxID, status);
        }

        public static int UpdateUnit(string ID,string UnitID, string GovernID, string UnitName, string address, string PostalCode, string ContactPerson, string ContactPhone, string HospitalLevel, string MaxID, string status)
        {
            UnitProvide up = new UnitProvide();
            return up.UpdateUnit(ID,UnitID, GovernID, UnitName, address, PostalCode, ContactPerson, ContactPhone, HospitalLevel, MaxID, status);
        }
        public static string getUnitName(string ID)
        {
            UnitProvide up = new UnitProvide();
            return up.getUnitNameByID(ID);
        }
        #endregion

        #region << Govern  >>
        public static DataSet getGovern()
        {
            UnitProvide up = new UnitProvide();
            DataSet dst = up.getGovern();

            return dst;
        }

        public static int UpdateAllowApplyofGovern(string GovernID, string allowApply)
        {
            UnitProvide up = new UnitProvide();
            return up.UpdateAllowApplyofGovern(GovernID, allowApply);
        }

        public static DataSet getGovern(string GovernName, string YorN)
        {
            UnitProvide up = new UnitProvide();
            DataSet dst = up.getGovern(GovernName, YorN);

            return dst;
        }

        public static int DeleteGovernByID(string ID)
        {
            UnitProvide up = new UnitProvide();
            return up.DeleteGovernByID(ID);
        }

        public static int InsertGovern(string GovernID, string GovernName, string PostalCode, string ContactPerson, string ContactPhone, string ApplyConfirmedInd, string Status)
        {
            UnitProvide up = new UnitProvide();
            return up.InsertGovern(GovernID, GovernName, PostalCode, ContactPerson, ContactPhone,ApplyConfirmedInd,Status);
        }

        public static int UpdateGovern(string ID,string GovernID, string GovernName, string PostalCode, string ContactPerson, string ContactPhone, string ApplyConfirmedInd, string Status)
        {
            UnitProvide up = new UnitProvide();
            return up.UpdateGovern(ID,GovernID, GovernName, PostalCode, ContactPerson, ContactPhone, ApplyConfirmedInd, Status);
        }

        public static DataSet getGovernByID(string ID)
        {
            UnitProvide up = new UnitProvide();
            return up.getGovernByID(ID);
        }
        public static DataSet getGovernByGovernID(string GovernID)
        {
            UnitProvide up = new UnitProvide();
            return up.getGovernByGovernID(GovernID);
        }

        public static string GetGovernName(string ID)
        {
            UnitProvide up = new UnitProvide();
            return up.GetGovernNameByID(ID);
        }
        #endregion
    }
}
